#!/usr/bin/env node

const https = require('http');
const addr = 'http://www.baidu.com';
https.get(addr,(res) => {
  console.log(`HTTP/${res.httpVersion} ${res.statusCode} ${res.statusMessage}`);//起始行
  console.log(res.headers);//响应头
  console.log(); //空行
  res.pipe(process.stdout); //响应体
});
